home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / os2 / xyos2shl.zip / INSTALL.CMD next >
OS/2 REXX Batch file  |  1996-06-03  |  11KB  |  402 lines

  1. /****
  2.  INSTALL.CMD for XYOS2SHL.ZIP  6/3/96  R.J.Holmgren
  3.  Locate in the directory that contains all unzipped XYOS2SHL files,
  4.  then command "INSTALL"
  5. ****/
  6.  
  7. '@echo off'
  8. 'cls'
  9. quot=""""
  10. last=''
  11. exclude='#'
  12.  
  13. if RxFuncQuery("SysLoadFuncs") then do
  14.   call RxFuncAdd "SysLoadFuncs","RexxUtil","SysLoadFuncs"
  15.   call SysLoadfuncs
  16.   end
  17.  
  18. Shell=translate(value('COMSPEC',,'OS2ENVIRONMENT'))
  19. if pos(':',Shell)\=2 then call BadShell
  20. Verify=stream(Shell,'C','query exists')
  21. if Verify='' then call BadShell
  22. call SysIni "BOTH","FolderWorkareaRunningObjects","ALL:","Objects"
  23. BootDrive=translate(left(Objects.1,1))
  24. currdir=directory()
  25. if right(currdir,1)='\' then currdir=left(currdir,length(currdir)-1)
  26. changedir=currdir
  27. mdosdir=BootDrive||":\OS2\MDOS"
  28. newdir=directory(mdosdir)
  29. if newdir=mdosdir then call directory currdir
  30. else do
  31.   say
  32.   say
  33.   say mdosdir" not found!"
  34.   say "XYOS2SHL.ZIP cannot be installed."
  35.   say
  36.   say BootDrive": should be the drive where OS/2 is installed;"
  37.   say "  directory \OS2\MDOS should provide DOS support."
  38.   call beep 1000,200
  39.   exit
  40.   end
  41.  
  42. say
  43. say
  44. say "        Xy-OS/2 Shell (XYOS2SHL.ZIP)"
  45. say "        ~~~~~~~ ~~~~~  ~~~~~~~~~~~~"
  46. say "         INSTALL.CMD v1.0d  6/3/96"
  47. say
  48. say "INSTALL needs to know the *fully-qualified* ""d:\dir"" of your XyWrite"
  49. say "U2 file, or, if no U2 file exists, of your XyDOS (v4.011+) or XyWin"
  50. say "editor (filenames EDITOR.EXE or XW.EXE), e.g.:"
  51. say
  52. say "    C:\XY4 or F:\XW"
  53. say
  54. say "INSTALL.CMD will place XYOS2SHL's XyWrite files (O2.PM, SW.PM,"
  55. say "RUNCMD.PM, LISTOBJS.CMD, XYOS2SHL.U2, and XYOS2SHL.DOC) in the"
  56. say "directory that you specify now.  All OS/2 files in this XYOS2SHL"
  57. say "package (O2.CMD, O2-ALIAS.DAT, O2.ICO, O2.BAT, SW.CMD, SW.BAT,"
  58. say "STARTOS2.EXE, PMSW.EXE, and TL.EXE) will be installed in the"
  59. say BootDrive||":\OS2\MDOS directory."
  60. say
  61. call charout ,"Hit ""Y"" to continue, or Escape to abort now?  (Y|n|esc) "
  62. dummy=''
  63. dummy=SysGetKey('noecho')
  64. parse upper var dummy dummy
  65. if dummy='1b'x then dummy='N'
  66. say
  67. if dummy='N' then do
  68.   say
  69.   say "Aborting"
  70.   exit
  71.   end
  72. do until length(xydir)>0
  73.   say
  74.   call charout ,"Enter name of XyWrite install Drive:\DIRectory: "
  75.   pull xydir
  76.   xydir=strip(xydir)
  77.   end
  78. say
  79. if right(xydir,1)='\' then xydir=left(xydir,length(xydir)-1)
  80. newdir=directory(xydir)
  81. if newdir\=xydir then do
  82.   say "Drive:\DIRectory "quot||xydir||quot" doesn't exist!"
  83.   say "XYOS2SHL.ZIP cannot be installed."
  84.   say "Start over and try again.  Aborting . . . "
  85.   say
  86.   call beep 1000,200
  87.   exit
  88.   end
  89. else call directory currdir
  90. say "Install XyWrite files to directory "||xydir
  91. say
  92.  
  93. arg.1="XYOS2SHL.DOC"
  94. arg.2="LISTOBJS.CMD"
  95. arg.3="O2-ALIAS.DAT"
  96. arg.4="O2.CMD"
  97. arg.5="SW.CMD"
  98. arg.6="O2.ICO"
  99. arg.7="PMSW.EXE"
  100. arg.8="TL.EXE"
  101. arg.9="STARTOS2.EXE"
  102. arg.10="O2.BAT"
  103. arg.11="SW.BAT"
  104. arg.12="O2.PM"
  105. arg.13="RUNCMD.PM"
  106. arg.14="SW.PM"
  107. arg.15="XYOS2SHL.DOC"
  108. arg.16="XYOS2SHL.U2"
  109. arg.17="LISTOBJS.CMD"
  110.  
  111. b="Testing   "
  112. initchk=0
  113. do c=1 to 14
  114.   call CheckIt
  115.   end
  116.  
  117. if pos('#1#',exclude)>0 then exclude=exclude||'15#'
  118.  
  119. copies=0
  120. b="Modifying "
  121. initchk=1
  122. text="«LBA»"
  123. x="«LBA»«SV01,"||BootDrive||"»;*;"
  124. do c=13 to 14
  125.   if pos('#'||c||'#',exclude)=0 then call ChangeIt
  126.   end
  127.  
  128. text="BootDrive="
  129. x="BootDrive="||quot||BootDrive||quot
  130. do c=4 to 5
  131.   if pos('#'||c||'#',exclude)=0 then call ChangeIt
  132.   end
  133.  
  134. if pos('#3#',exclude)=0 then do
  135.   c=3
  136.   text="FullScreen"
  137.   x="="||quot||"FullScreen OS/2 Command Session"||quot||" /C /FS /P:XyWr /R call directory "||quot||BootDrive||":\"||quot||"; "||quot||Shell||quot
  138.   call ChangeIt
  139.   text="Full_Screen"
  140.   x="="||quot||"Full_Screen OS/2 Command Session"||quot||" /C /FS /P:XyWr "||Shell
  141.   call ChangeIt
  142.   text="OS/2_Window"
  143.   x="w="||quot||"OS/2_Window"||quot||" /C /WIN /P:XyWr "||Shell
  144.   call ChangeIt
  145.   text="Global Explorer"
  146.   x="e="||quot||"Global Explorer"||quot||" /C /M:"||BootDrive||":\TCPIP\BIN\TELNET.ICO "||BootDrive||":\TCPIP\BIN\EXPLORE.EXE -q -t 8"
  147.   call ChangeIt
  148.   text="time="
  149.   x="time=/b /c /M:"||BootDrive||":\OS2\MDOS\O2.ICO NISTIME.EXE -s1"
  150.   call ChangeIt
  151.   end
  152.  
  153. if pos('#10#',exclude)=0 then do
  154.   c=10
  155.   text="p:Xy"
  156.   x="echo /e /h /p:Xy > "||BootDrive||":\os2\mdos\o2.ini"
  157.   call ChangeIt
  158.   text="%9"
  159.   x="echo %1 %2 %3 %4 %5 %6 %7 %8 %9 >> "||BootDrive||":\os2\mdos\o2.ini"
  160.   call ChangeIt
  161.   text="startos2"
  162.   x=BootDrive||":\os2\mdos\startos2.exe "||quot||"OS2 from DOS"||quot||" /c /fs "||BootDrive||":\os2\mdos\o2.cmd > "||"NUL"
  163.   call ChangeIt
  164.   end
  165.  
  166. if pos('#11#',exclude)=0 then do
  167.   c=11
  168.   text="startos2"
  169.   x=BootDrive||":\os2\mdos\startos2.exe /c /b /fs "||BootDrive||":\os2\mdos\sw.cmd %1 %2 > "||"NUL"
  170.   call ChangeIt
  171.   end
  172.  
  173. if pos('#12#',exclude)=0 then do
  174.   c=12
  175.   text="«LBA»"
  176.   x="«LBA»«SV661,"||BootDrive||"»;*;"
  177.   call ChangeIt
  178.   text="ICO file"
  179.   x="«SV667,/M:"||BootDrive||":\os2\mdos\o2.ico»;*; ICO file"
  180.   call ChangeIt
  181.   text="Get COMSPEC"
  182.   x="«IF«VA|684»<1»«SV684,"||Shell||"»«EI»;*; Get COMSPEC"
  183.   call ChangeIt
  184.   end
  185.  
  186. if pos('#13#',exclude)=0 then do
  187.   c=13
  188.   text="CMD Big Screen"
  189.   x="«SV01,""CMD Big Screen""»«SX50,«IS01»+"" /C /FS /I /R call directory '""+«VA$PA»+""'; '"||Shell||"'""» üú éú2.o2 é"
  190.   call ChangeIt
  191.   end
  192.  
  193. b="Creating  "
  194. if pos('#12#',exclude)=0&pos('#13#',exclude)=0&pos('#14#',exclude)=0 then do
  195.   c=16
  196.   x='echo ;U2;> '||currdir||'\XYOS2SHL.U2'
  197.   x
  198.   x='echo «SS0,SZ=12PT,UF=STANDARD,LM=0,RM=0,PW=85DI,OF=0,4DI,IP=0,0,0,NJ,HY=0,PL=273LI,273LI,273LI,FD=273LI,TP=0,BT=0,RT=0,TS=16DI,24DI,32DI»«US0»>> '||currdir||'\XYOS2SHL.U2'
  199.   x
  200.   x='echo XYOS2SHL.U2 [XYOS2SHL.ZIP] by R.J.Holmgren  6/3/96>> '||currdir||'\XYOS2SHL.U2'
  201.   x
  202.   x='copy '||currdir||'\XYOS2SHL.U2+'||currdir||'\'||arg.12||'+'||currdir||'\'||arg.14||'+'||currdir||'\'||arg.13||'> '||'NUL'
  203.   x
  204.   call CheckIt
  205.   end
  206. else exclude=exclude||'16#'
  207.  
  208. newdir=mdosdir
  209. do c=3 to 11
  210.   if pos('#'||c||'#',exclude)=0 then call copy
  211.   end
  212.  
  213. newdir=xydir
  214. do c=12 to 17
  215.   if pos('#'||c||'#',exclude)=0 then call copy
  216.   end
  217.  
  218. say
  219. b="Proving   "
  220. initchk=0
  221. changedir=mdosdir
  222. do c=3 to 11
  223.   call CheckIt
  224.   end
  225.  
  226. changedir=xydir
  227. do c=12 to 17
  228.   call CheckIt
  229.   end
  230. say
  231.  
  232. lister=xydir||'\LISTOBJS.CMD'
  233. rc=stream(lister,'C','query exists')
  234. if rc\=''&pos('#17#',exclude)=0 then do
  235.   rc=SysCreateObject('WPFolder',,
  236.   'Xy-OS/2 Shell',,
  237.   '<WP_DESKTOP>',,
  238.   'OBJECTID=<XYOS2SHL>;OPEN=ICON;ICONFILE='||mdosdir||'\O2.ICO',,
  239.   'ReplaceIfExists')
  240.   if rc=0 then say 'Failed to Create Xy-OS/2 Shell Folder'
  241.   else do
  242.     say 'Folder '||quot||'Xy-OS/2 Shell'||quot||' Created'
  243.     rc=SysCreateObject('WPProgram',,
  244.     'List WPS Titles^and ObjectIDs',,
  245.     '<XYOS2SHL>',,
  246.     'OBJECTID=<LISTOBJS>;EXENAME='||lister||';PROGTYPE=WINDOWABLEVIO;ICONFILE='||mdosdir||'\O2.ICO',,
  247.     'ReplaceIfExists')
  248.     if rc=0 then say 'Failed to Create LISTOBJS.CMD Object'
  249.     else say quot||'LISTOBJS.CMD'||quot||' Object Created'
  250.     rc=SysCreateObject('WPShadow',,
  251.     'Xy-OS/2 Shell.Doc',,
  252.     '<XYOS2SHL>',,
  253.     'SHADOWID='||xydir||'\XYOS2SHL.DOC',,
  254.     'ReplaceIfExists')
  255.     if rc=0 then say 'Failed to Create XYOS2SHL.DOC Object'
  256.     else say quot||'XYOS2SHL.DOC'||quot||' Object Created'
  257.     end
  258.   end
  259.  
  260. Path=translate(value('PATH',,'OS2ENVIRONMENT'))
  261. Path=Path||';'
  262. if pos(mdosdir,Path)=0 then do
  263.   call beep 1000,200
  264.   say '                IMPORTANT NOTE:'
  265.   say '                ~~~~~~~~~ ~~~~'
  266.   say 'The location of important Xy-OS/2 Shell files, e.g. O2.CMD,'
  267.   say 'is not in the current PATH.  Modify CONFIG.SYS to include'
  268.   say mdosdir||';'
  269.   say 'in the PATH statement, then Shutdown and reboot OS/2.'
  270.   end
  271.  
  272. say
  273. 'pause'
  274.  
  275. 'cls'
  276. say
  277. say
  278. say "XYOS2SHL INSTALL executed without error"
  279. say 'Number of files installed: '||copies||' (of 15)'
  280. say
  281. if pos('#16#',exclude)=0 then do
  282.   say "File XYOS2SHL.U2 has been *newly created* and now exists in"
  283.   say "your "||xydir||" directory.  Insert XYOS2SHL.U2 within your U2 file"
  284.   say "(if U2 exists), or else edit your STARTUP.INT|XWSTART.INT"
  285.   say "file to issue command ""LOAD "||xydir||"\XYOS2SHL.U2""."
  286.   say
  287.   say "Put the following command on an empty key in your keyboard file,